package com.insideClass;

import com.insideClass.typeinfo.*;

import java.util.*;

/**
 * @author 13699
 */
public class MapOfList {
    public static Map<Person, List<? extends Pet>>
            petpeople=new HashMap<>();
    static{
        petpeople.put(new Person("Dawn"),
                Arrays.asList(new Cymric("Molly"),
                        new Mutt("spot")));
        petpeople.put(new Person("Kate"),
                Arrays.asList(new Cat("Shackleton"),
                        new Dog("Margrett")));
        petpeople.put(new Person("Marilyn"),
                Arrays.asList(new Pug("Louie aka Louis Snorkelstein Dupree"),
                        new Cat("Stanford aka Stinky el Negro"),
                        new Cat("Pinkola")));
        petpeople.put(new Person("Luke"),
                Arrays.asList(new Rat("Fuzzy"),new Rat("Fizzy")));
        petpeople.put(new Person("Isaac"),Arrays.asList(new Rat("Freckly")));
    }

    public static void main(String[] args) {
        System.out.println("People:"+petpeople.keySet());
        System.out.println("Pets:"+petpeople.values());
        for (Person person:
             petpeople.keySet()) {
            System.out.println(person+"has:");
            for (Pet pet:
                 petpeople.get(person)) {
                System.out.println(" "+pet);
            }
        }
    }
}
